package pack1;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import javax.print.DocFlavor.STRING;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public class sprg30 {

public static void main(String[] args) throws InvalidFormatException, IOException {
FileInputStream fis = new FileInputStream("d:\\book1.xlsx");
  Workbook wb = WorkbookFactory.create(fis);
  Sheet s = wb.getSheet("sheet1");
Row r = s.getRow(0);

Cell v = r.getCell(3);  
String ss=v.getStringCellValue();
System.out.println(ss);
//---------------------------------------------
  FileInputStream fs = new FileInputStream("d://book1.xlsx");

Workbook w = WorkbookFactory.create(fs);
Sheet sh = w.getSheet("sheet1");
Row rr = sh.getRow(0);
Cell cc = rr.getCell(0);
String str=cc.getStringCellValue();
System.out.println(str);
}
}
